********************************************************************************
** Purpose: Replication Code for Tables in Appendix
** Project: Missionary Activity, Education, and Long-run Political Development  
** Written by: Soeren J. Henn  
** Last updated: 2025-05-29
********************************************************************************

version 13.1 
clear all
set more off 
set maxvar 32200

**!!!!!! add location of Replication Archive here
else if c(username) == "soerenhenn" {
	global dir "~/Dropbox/Missionaries/Replication Archive"
}
else {
	display as error "Please specify root directory"
	exit 
}  

global data "$dir/data"
global code "$dir/code"
global output "$dir/output"
	
********************************************************************************
*********************************** Load data **********************************
********************************************************************************
use "$data/analysis_data.dta", clear	
	
drop if T_Closer10==.
	
cd "$output"
	

********************************************************************************
****************** Table A1: Summary Statistic of full sample ******************
********************************************************************************
foreach var in voted_dum contact_loc attend_comm raised_issue radio_news discuss_politics employed_dum over_perf_inc close_inc_party close_opp_party{
	egen z_`var' = std(`var')
}
alpha z_voted_dum z_contact_loc z_attend_comm z_raised_issue, gen(index_participation) std
alpha z_raised_issue z_attend_comm, gen(index_community1) std
alpha z_employed_dum z_radio_news z_discuss_politics, gen(index_sophistication) std
alpha op_reject_oneparty op_reject_oneman op_pres_obey op_pres_disc, gen(support_inst) std
alpha z_close_opp_party z_close_inc_party, gen(index_inc) std
alpha z_over_perf_inc index_inc, gen(index_perfinc) std
	

estpost summarize Proximity_DioceseHead Dist_Border Catholic50kms_Same Catholic50kms_Different ///
	catholic_m schooling_ordinal primary_inc secondary_inc  skilled_labour ///
	index_participation voted_dum contact_loc index_community1 attend_comm raised_issue ///
	index_sophistication radio_news discuss_politics employed_dum ///
	sat_dem support_inst index_perfinc over_perf_inc close_inc_party close_opp_party

esttab using "table_A1.tex", ///
    cells("mean(fmt(2)) sd(fmt(2)) min(fmt(2)) max(fmt(2))") ///
    nonumber nomtitle nonote replace ///
    collabels("Mean" "Std. Dev." "Min" "Max")
	
********************************************************************************
****************** Table A2: Summary Statistic of democracies ******************
********************************************************************************
preserve 
keep if Democracy==1
estpost summarize Proximity_DioceseHead Dist_Border Catholic50kms_Same Catholic50kms_Different ///
	catholic_m schooling_ordinal primary_inc secondary_inc  skilled_labour ///
	index_participation voted_dum contact_loc index_community1 attend_comm raised_issue ///
	index_sophistication radio_news discuss_politics employed_dum ///
	sat_dem support_inst index_perfinc over_perf_inc close_inc_party close_opp_party

esttab using "table_A2.tex", ///
    cells("mean(fmt(2)) sd(fmt(2)) min(fmt(2)) max(fmt(2))") ///
    nonumber nomtitle nonote replace ///
    collabels("Mean" "Std. Dev." "Min" "Max")
restore

********************************************************************************
**************** Table A2: Summary Statistic of open anocracies ****************
********************************************************************************
preserve 
keep if Open_anocracy==1
estpost summarize Proximity_DioceseHead Dist_Border Catholic50kms_Same Catholic50kms_Different ///
	catholic_m schooling_ordinal primary_inc secondary_inc  skilled_labour ///
	index_participation voted_dum contact_loc index_community1 attend_comm raised_issue ///
	index_sophistication radio_news discuss_politics employed_dum ///
	sat_dem support_inst index_perfinc over_perf_inc close_inc_party close_opp_party

esttab using "table_A3.tex", ///
    cells("mean(fmt(2)) sd(fmt(2)) min(fmt(2)) max(fmt(2))") ///
    nonumber nomtitle nonote replace ///
    collabels("Mean" "Std. Dev." "Min" "Max")
restore

********************************************************************************
*************** Table A3: Summary Statistic of closed anocracies ***************
********************************************************************************
preserve 
keep if Close_anocracy==1
estpost summarize Proximity_DioceseHead Dist_Border Catholic50kms_Same Catholic50kms_Different ///
	catholic_m schooling_ordinal primary_inc secondary_inc  skilled_labour ///
	index_participation voted_dum contact_loc index_community1 attend_comm raised_issue ///
	index_sophistication radio_news discuss_politics employed_dum ///
	sat_dem support_inst index_perfinc over_perf_inc close_inc_party close_opp_party

esttab using "table_A4.tex", ///
    cells("mean(fmt(2)) sd(fmt(2)) min(fmt(2)) max(fmt(2))") ///
    nonumber nomtitle nonote replace ///
    collabels("Mean" "Std. Dev." "Min" "Max")
restore

********************************************************************************
****************** Table A7: Correlates of Diocese Boundaries ******************
********************************************************************************

** Code is in R script table_A7.R

********************************************************************************
** Table A8: Effect of Proximity to Diocese Headquarters on Modern-Day Schools per Grid Controlling for Population Density 1880 **
********************************************************************************

** Code is in R script figure_4_and_table_A8.R

********************************************************************************
** Table A9: Effect on voted, contacted local councilor, attended community meeting and raised issue **
********************************************************************************
	
********** Panel A:  Voting

	local controls "age female"
	
		reghdfe  voted_dum Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe  voted_dum Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe  voted_dum Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe  voted_dum Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A9_a.tex, replace se r2 label title(Effect on Voting) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 

		
********** Panel B: Contacted Local Councilor

	local controls "age female"
	
		reghdfe contact_loc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe contact_loc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe contact_loc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe contact_loc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A9_b.tex, replace se r2 label title(Effect on Contacted Local Councilor) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 
	
	
********** Panel C:  Attended Community Meeting

	local controls "age female"
	
		reghdfe attend_comm Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe attend_comm Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe attend_comm Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe attend_comm Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A9_c.tex, replace se r2 label title(Effect on Attendance at Community Meeting) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 
	
	
********** Panel D: Raised Issue

	local controls "age female"
	
		reghdfe raised_issue Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe raised_issue Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe raised_issue Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe raised_issue Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A9_d.tex, replace se r2 label title(Effect on Raised Issue) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 
		
********************************************************************************
******* Table A10: Effect on radio news consumption and discuss politics *******
********************************************************************************
	
********** Panel A: Radio Ordinal	

	local controls "age female"
	
		reghdfe radio_news Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe radio_news Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe radio_news Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe radio_news Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A10_a.tex, replace se r2 label title(Effect on Radio Ordinal) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 
		
********** Panel B: Discuss Politics

	local controls "age female"
	
		reghdfe discuss_politics Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe discuss_politics Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe discuss_politics Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe discuss_politics Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A10_b.tex, replace se r2 label title(Effect on Radio Ordinal) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 
		
********************************************************************************
************ Table A11: Effect on incumbent performance and support ************
********************************************************************************
	
********** Panel A: Performance
		
	local controls "age female"
	
		reghdfe over_perf_inc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe over_perf_inc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe over_perf_inc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe over_perf_inc Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
	
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A11_a.tex, replace se r2 label title(Effect on Performance only) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 
		
********** Panel B: Close to Incumbent Party
		
	local controls "age female"
	
		reghdfe close_inc_party Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe close_inc_party Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe close_inc_party Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe close_inc_party Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
				

		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A11_b.tex, replace se r2 label title(Effect on Close to Incumbent Party) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 	

********** Panel C: Close to Opposition Party
		
	local controls "age female"
	
		reghdfe close_opp_party Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe close_opp_party Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe close_opp_party Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe close_opp_party Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A11_c.tex, replace se r2 label title(Effect on Close to Opposition Party) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 
	


********************************************************************************
*********** Table A12: Effect on Attending Protests and Vote Selling ***********
********************************************************************************

********* Panel A: Attending Protests
		
local controls "age female"
	
		reghdfe protest Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe protest Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe protest Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe protest Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A12_a.tex, replace se r2 label title(Effect on Attending Protests) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 	
		
********** Panel B: Vote Selling
		
	local controls "age female"
	
		reghdfe vote_buying Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe vote_buying Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Democracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_dem
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe vote_buying Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Open_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_open
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
		reghdfe vote_buying Proximity_DioceseHead 1.T_Closer10#c.Dist_Border10 Dist_Border10 `controls' if Dist_Border<=10 & Close_anocracy==1, a(Border_Unique round) cluster(Border_Unique)
		est sto v_1_closed
		estadd local FE_border "YES"
		estadd local FE_country "NO"
		estadd local FE_round "YES"
		estadd local Cluster "BORDER"
		estadd ysumm
		
	esttab v_1 v_1_dem v_1_open v_1_closed using table_A12_b.tex, replace se r2 label title(Effect on Vote Buying) ///
		scalars("FE_border Border FEs" "FE_round AB Round FEs" "FE_country Country FEs" "Cluster Cluster" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 	
		

********************************************************************************
** Table A34: Correlation Between Education/Missionary Activity and Index of Political Participation **
********************************************************************************

use "$data/analysis_data.dta", clear	
	
cd "$output"

foreach var in voted_dum contact_loc attend_comm raised_issue radio_news discuss_politics employed_dum over_perf_inc close_inc_party close_opp_party{
	egen z_`var' = std(`var')
}
alpha z_voted_dum z_contact_loc z_attend_comm z_raised_issue, gen(index_participation) std

local controls "age female"
	
	
********** Panel A: Education
reghdfe index_participation secondary age female, a(country_id round)
est sto r_1
estadd local FE_country "Yes"
estadd local FE_round "YES"
estadd ysumm

reghdfe index_participation secondary age female if Democracy==1, a(country_id round)
est sto r_2
estadd local FE_country "Yes"
estadd local FE_round "YES"
estadd ysumm

reghdfe index_participation secondary age female if Open_anocracy==1, a(country_id round)
est sto r_3
estadd local FE_country "Yes"
estadd local FE_round "YES"
estadd ysumm

reghdfe index_participation secondary age female if Close_anocracy==1, a(country_id round)
est sto r_4
estadd local FE_country "Yes"
estadd local FE_round "YES"
estadd ysumm

esttab r_1 r_2 r_3 r_4 using table_A34_a.tex, replace se r2 label title(Correlation Between Secondary Education and Index of Political Particiaption) ///
		scalars("FE_country Country FEs" "FE_round AB Round FEs" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 

********** Panel B: Number of catholic missions within 50km
gen any_catholic = 0
replace any_catholic = any_catholic+Catholic50kms_Same if Catholic50kms_Same>0 & Catholic50kms_Same!=.
replace any_catholic = any_catholic+Catholic50kms_Different if Catholic50kms_Different>0 & Catholic50kms_Different!=.

reghdfe index_participation any_catholic age female, a(country round)
est sto r_1
estadd local FE_country "Yes"
estadd local FE_round "YES"
estadd ysumm

reghdfe index_participation any_catholic age female if Democracy==1, a(country round)
est sto r_2
estadd local FE_country "Yes"
estadd local FE_round "YES"
estadd ysumm

reghdfe index_participation any_catholic age female if Open_anocracy==1, a(country round)
est sto r_3
estadd local FE_country "Yes"
estadd local FE_round "YES"
estadd ysumm

reghdfe index_participation any_catholic age female if Close_anocracy==1, a(country round)
est sto r_4
estadd local FE_country "Yes"
estadd local FE_round "YES"
estadd ysumm
esttab r_1 r_2 r_3 r_4 using table_A34_b.tex, replace se r2 label title(Correlation Between Number of Catholic Missions within 50km and Index of Political Particiaption) ///
		scalars("FE_country Country FEs" "FE_round AB Round FEs" ///
		"ymean Mean of Outcome" "ysd SD of Outcome" "ymin Min of Outcome" "ymax Max of Outcome") ///
		star(* 0.10 ** 0.05 *** 0.01) ///
		drop(_cons `controls') ///
		mtitles("Pooled" "Democracies" "Open Anocracies" "Closed Anocarcies" "Interaction") 

		